package cn.wolfcode.crm.service.impl;

import cn.wolfcode.crm.domain.Experience;
import cn.wolfcode.crm.mapper.ExperienceMapper;
import cn.wolfcode.crm.service.IExperienceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ExperienceServiceImpl implements IExperienceService {
    @Autowired
    private ExperienceMapper mapper;
    public void save(Experience experience) {
        mapper.insert(experience);

    }

    public void delete(Long id) {
        mapper.deleteByPrimaryKey(id);
    }

    public void update(Experience experience) {
        System.out.println(experience);
        mapper.updateByPrimaryKey(experience);
    }

    public Experience get(Long id) {
        Experience experience = mapper.selectByPrimaryKey(id);
        return experience;
    }

    public List<Experience> listAll() {
        List<Experience> list = mapper.selectAll();
        return list;
    }

}
